home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Collision Detects !!!!
- References: <199604051601.QAA18722@mailhost.unibol.com>
- X-Newsreader: TIN [version 1.2 PL2]
- Path: imada.ou.dk!breese
- From: breese@imada.ou.dk (Bjorn Reese)
- Message-ID: <1996Apr7.111956.23541@imada.ou.dk>
- Sender: news@imada.ou.dk
- Nntp-Posting-Host: wagner.imada.ou.dk
- Organization: Dept. of Math. & Computer Science, Odense University, Denmark
- Date: Sun, 7 Apr 1996 11:19:56 GMT
- Newsgroups: comp.sys.amiga.programmer
-
- John Girvin (jgirvin@bfs.unibol.com) wrote:
-
- > if ( (px2 - bullet[i]->x) < (bullet[i]->width + player->width) &&
- > ^^^ ^^^^^^^^^^^^
- > swapped!
-
- Ok, makes sense now. I simply love it!
-
- > :>as player->width is present on both sides of the inequality it can be
- > :>omitted.
- > Well spotted! I never noticed that myself :) I dont think it would make
-
- On a second look it would be fatal to remove player->width from the
- inequality. I was initially puzzled by it's appearence, but now I've
- realized that it's the principal cause why the unsigned comparison works.
- The player->width on the right hand side of the inequality becomes
- insignificant when the bullet is too far right, whereas the one on the
- left hand side doesn't.
-
- > Not necessarily, I think. I read one document that claimed to solve
- > this problem by shifting the sector dividing lines by half a sector
- > width&height and repeating the collision check 4 times in all for
- > :x,y x+0.5,y x,y+0.5 x+0.5,y+0.5. It was something like that anyway,
-
- While I conceptually get the idea, I wonder how they can make such
- a division on a linked list (or an array for that matter.) They must
- be using a different implementation of subsectoring than the ones I
- know of. I would definitely like to see that document.
-
- > but dont quote me - youve seen what my memory is like already ;)
-
- Yeah, seems to be very compatible with mine :)
-
- --
- Bjorn Reese Email: breese@imada.ou.dk
- Odense University, Denmark URL: http://www.imada.ou.dk/~breese
-
- "It's getting late in the game to show any pride or shame" - Marillion
-